 (function () {
     "use strict";

     app.filter('firstLetter', function () {
         return function (text) {
             return text.charAt(0).toUpperCase();
         }
     });


     app.filter('literalDate', ["$filter", function ($filter) {
         return function (text) {
             if (!text) return "";
             var type = typeof text;
             if (type == "string") {
                 type = new Date(text);
                 type = "date";
             }
             if (type == "date") {
                 text = $filter('date')(text, "dd/MM/yyyy");
             }

             var now = new Date();
             var today = $filter('date')(now, "dd/MM/yyyy");
             if (text == today) return "Aujourd'hui";

             now.setDate(now.getDate() - 1);
             var yesturday = $filter('date')(now, "dd/MM/yyyy");

             if (text == yesturday) return "Hier";

             var dateParts = text.split("/");
             var date = new Date(dateParts[2], (dateParts[1] - 1), dateParts[0]);

             return $filter('date')(date, "d MMM");
         }
     } ]);


 })();